#ifndef journalwindow_H
#define journalwindow_H

#include <KXmlGuiWindow>
#include <KTabWidget>
#include <QActionGroup>
#include <QComboBox>

class JournalTabWidget;
class MainControl;

/**
 * The main window shown to the user.
 */
class JournalWindow : public KXmlGuiWindow {
    Q_OBJECT

public:
    /**
     * Creates a new JournalWindow with the given parent.
     */
    JournalWindow(QWidget *parent=0);

    /**
     * Overridden to emit a signal when the window is shown so the control can react to that.
     */
    void show();

    /**
     * Returns a reference to the window's JournalTabWidget.
     */
    JournalTabWidget* getTabWidget();

private:
    /**
     * The JournalTabWidget used to manage the openend Documents.
     */
    JournalTabWidget *m_tabWidget;

    /**
     * The MainControl object that handles the actions the user performs on this window.
     */
    MainControl *m_control;

    /**
     * The ActionGroup for the tool selection actions.
     */
    QActionGroup *m_toolActionGroup;

    /**
     * The ActionGroup for the pen size selection actions.
     */
    QActionGroup *m_penSizeGroup;

    /**
     * Creates and configures the actions that are given to the user.
     */
    void setupActions();

    /**
     * Configures the JournalTabWidget used to manage the opened Documents.
     */
    void configureTabWidget();

    // TODO: Update the toolbar when the document-tab has switched to another document (tools,scale,pen)

signals:
    /**
     * Emitted when show() is called.
     */
    void windowLoaded();

};

#endif